package cate.common.game;

public class GameCollection {

    public static final String NAME_ROLE_BASE = "role_base";
    public static final String NAME_ROLE_BAG = "role_bag";
    public static final String NAME_ROLE_FIGHT = "role_fight";
    public static final String NAME_ROLE_MAIL = "role_mail";
    public static final String NAME_ROLE_FRIEND = "role_friend";
    public static final String NAME_ROLE_MALL = "role_mall";
    public static final String NAME_ROLE_CHAT = "role_chat";
    public static final String NAME_ROLE_PAY = "role_pay";
    public static final String NAME_ROLE_WORLD = "role_world";
    public static final String NAME_ROLE_NOTE = "role_note";
    public static final String NAME_ROLE_SYSTEM = "role_system";
    public static final String NAME_ROLE_STATUS = "role_status";
    public static final String NAME_ROLE_RES = "role_res";
    public static final String NAME_ROLE_FARM = "role_farm";
    public static final String NAME_ROLE_PVP = "role_pvp";
    public static final String NAME_ROLE_ACTIVITY = "role_activity";
    public static final String NAME_ROLE_TASK = "role_task";
    public static final String NAME_ROLE_HISTORY = "role_history";
    public static final String NAME_ROLE_SHOW = "role_show";
    public static final String NAME_ROLE_TRACE = "role_trace";

    public static final String NAME_KV = "kv";
    public static final String NAME_RANK = "rank";
    /** 待合并的排行榜数据 */
    public static final String NAME_RANK_MERGING = "rank_merging";
    public static final String NAME_MAILBOX = "mailBox";
    public static final String NAME_PLAY = "play";
    public static final String NAME_GUILD = "guild";
    public static final String NAME_HERO_DISPLAY = "hero_display";
    public static final String NAME_STATUS = "status";
    public static final String NAME_FRIENDBOX = "friendBox";

    public static String[] getUidCollections() {
        return new String[] {
                NAME_ROLE_BASE, NAME_ROLE_BAG, NAME_ROLE_FIGHT, NAME_ROLE_MAIL,
                NAME_ROLE_FRIEND, NAME_ROLE_MALL, NAME_ROLE_CHAT, NAME_ROLE_PAY,
                NAME_ROLE_WORLD, NAME_ROLE_NOTE, NAME_ROLE_SYSTEM, NAME_ROLE_STATUS,
                NAME_ROLE_RES, NAME_ROLE_FARM, NAME_ROLE_PVP, NAME_ROLE_ACTIVITY,
                NAME_ROLE_TASK, NAME_ROLE_HISTORY, NAME_ROLE_SHOW,
                NAME_MAILBOX, NAME_PLAY, NAME_GUILD, NAME_HERO_DISPLAY, NAME_FRIENDBOX
        };
    }

    /** 获取需要合服的collection */
    public static String[] getMergeRequiredCollections() {
        return new String[] {
                NAME_ROLE_BASE, NAME_ROLE_BAG, NAME_ROLE_FIGHT, NAME_ROLE_MAIL,
                NAME_ROLE_FRIEND, NAME_ROLE_MALL, NAME_ROLE_CHAT, NAME_ROLE_PAY,
                NAME_ROLE_WORLD, NAME_ROLE_NOTE, NAME_ROLE_SYSTEM, NAME_ROLE_STATUS,
                NAME_ROLE_RES, NAME_ROLE_FARM, NAME_ROLE_PVP, NAME_ROLE_ACTIVITY,
                NAME_ROLE_TASK, NAME_ROLE_HISTORY, NAME_ROLE_SHOW,
                NAME_MAILBOX, NAME_GUILD, NAME_FRIENDBOX
        };
    }

    public static final String RANK_MERGE_TAG = "_s_";
    public static String toRankMergeKey(String rankKey, int srvId) {
        return rankKey + RANK_MERGE_TAG + srvId;
    }
    public static boolean matchRankMergeKey(String rankMergeKey, int srvId) {
        return rankMergeKey.endsWith(RANK_MERGE_TAG + srvId);
    }
}
